<?php

     include("common.php");

    if (session_is_registered(MySBB_Admin_username) and $member_permission == 1)
    {

// **  **

         if ($_GET['news'] == 1)
         {
             $SF->html_title_page('آخر خبر - (Powered By MySmartBB)');
             $SF->html('</td></tr></table><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td valign="top">');

             $get_news = @file('http://www.mysmartbb.com/check/news.php') or die($SF->error('لم يتمكن من فتح الملف'));

             for ($i=0;$i<=count($get_news);$i++)
             {
                 $SF->msg($get_news[$i]);
             }
         }

// **  **

         if ($_GET['last_topic'] == 1)
         {
             $SF->html_title_page('آخر المواضيع في المنتدى - (Powered By MySmartBB)');
             $SF->html('</td></tr></table><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td valign="top">');

             $get_topic = @file('http://www.mysmartbb.com/check/last_topic.php') or die($SF->error('لم يتمكن من فتح الملف'));

             for ($i=0;$i<=count($get_topic);$i++)
             {
                 $SF->msg($get_topic[$i]);
             }
         }

// **  **

         if ($_GET['note'] == 1)
         {
             $update = $DB->sql_query("UPDATE " . $db_prefix . "member SET user_notes='" . $_POST['S1'] . "' WHERE id='" . $member_row['id'] . "'");
             if ($update)
             {
                 $SF->msg('تم التحديث بنجاح !');
                 $SF->go_to('misc.php?main=1',1);
             }
         }

// **  **


         if ($_GET['main'] == 1)
         {
             $fast_static                        = array();
             $fast_static['member_number']       = $DB->sql_num_rows($DB->sql_query("SELECT * FROM " . $db_prefix . "member"));
             $fast_static['memeractive_number']  = $DB->sql_num_rows($DB->sql_query("SELECT * FROM " . $db_prefix . "member WHERE posts<>'0'"));
             $fast_static['section_number']      = $DB->sql_num_rows($DB->sql_query("SELECT * FROM " . $db_prefix . "section"));
             $fast_static['topic_number']        = $DB->sql_num_rows($DB->sql_query("SELECT * FROM " . $db_prefix . "subject WHERE delete_topic<>'1'"));
             $fast_static['reply_number']        = $DB->sql_num_rows($DB->sql_query("SELECT * FROM " . $db_prefix . "reply WHERE delete_topic<>'1'"));
             $fast_static['todayreg_number']     = $DB->sql_num_rows($DB->sql_query("SELECT * FROM " . $db_prefix . "member WHERE register_date='" . date("Y-m-d") . "'"));
             $fast_static['todaysubject_number'] = $DB->sql_num_rows($DB->sql_query("SELECT * FROM " . $db_prefix . "subject WHERE write_date='$date'"));
             $fast_static['todayreply_number']   = $DB->sql_num_rows($DB->sql_query("SELECT * FROM " . $db_prefix . "reply WHERE write_date='$date'"));

             $get_version = @file('http://www.mysmartbb.com/check/version.php');
             if ($get_version == FALSE)
             {
                 $Smarty->assign('fail',1);
             }

             if ($get_version[0] != $info_row['MySBB_version'])
             {
                 $Smarty->assign('new-v-available',1);
                 $Smarty->assign('version',$get_version[0]);
             }elseif ($get_version[0] == $info_row['MySBB_version'])
             {
                 $Smarty->assign('newva-v-ailable',0);
                 $Smarty->assign('version',$get_version[0]);
             }

             $Smarty->assign_by_ref('fast_static',$fast_static);
             $Smarty->display('index_page.tpl');
         }

// **  **

    }

?>